Moose and error messages, the sun and the moon [closed]

Posted by xxxxxxx on Stack Overflow See other posts from Stack Overflow or by xxxxxxx
Published on 2010-03-10T15:39:22Z Indexed on 2010/03/12 17:57 UTC
Read the original article Hit count: 597

Filed under:
|
|
|
|

So again using Moose I write a role like this:

package My::Role;
use Moose::Role;
use Some::Class::Consuming::My::Role;

With the note that Some::Class::Consuming::My::Role consumes the role My::Role;

And what do I get ? I get an error message like this:

A role generator is required to generate roles at /usr/local/share/perl/5.10.0/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm line 79
    MooseX::Role::Parameterized::Meta::Role::Parameterizable::generate_role('MooseX::Role::Parameterized::Meta::Role::Parameterizable=HASH...', 'consumer', 'Moose::Meta::Class=HASH(0x894e540)', 'parameters', 'HASH(0x86fc1e0)') called at /usr/local/share/perl/5.10.0/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm line 116
    MooseX::Role::Parameterized::Meta::Role::Parameterizable::apply('MooseX::Role::Parameterized::Meta::Role::Parameterizable=HASH...', 'Moose::Meta::Class=HASH(0x894e540)', 'element_type', 'Tuple') called at /usr/local/lib/perl/5.10.0/Moose/Util.pm line 132
    Moose::Util::_apply_all_roles('Moose::Meta::Class=HASH(0x894e540)', undef, 'Stuff', 'HASH(0x894e1d0)') called at /usr/local/lib/perl/5.10.0/Moose/Util.pm line 86
    Moose::Util::apply_all_roles('Moose::Meta::Class=HASH(0x894e540)', 'Stuff', 'HASH(0x894e1d0)') called at /usr/local/lib/perl/5.10.0/Moose.pm line 57
    Moose::with('Moose::Meta::Class=HASH(0x894e540)', 'Group', 'HASH(0x894e1d0)') called at /usr/local/lib/perl/5.10.0/Moose/Exporter.pm line 293
    Moose::with('Group', 'HASH(0x894e1d0)') called at Some_path_on_disk line 6
    require Some_other_path_on_disk called at Some_path_on_disk line 9
    Group::BEGIN() called at Yet_another_path_on_disk line 0
    eval {...} called at  Yet_another_path_on_disk line 0
Compilation failed in require at some_path_on_disk line 9.
BEGIN failed--compilation aborted at some_path_on_disk line 9.

What am I to make of this ? As Dijkstra would concisely describe, this looks like "just a meaningless concatenation of words"(which is exactly what it is).

Would a more appropriate error message be "You cannot use a class consuming the role that you are currently defining " ?

  1. What does the error message try to convey ?
  2. Can the author make the error message meaningful ? Will he ever make it so ? maybe this can be planned for version 3.14159265358979323846 ?

In actuality I get one and a half pages of error which is completely unreadable and devoid of any logic or sense of respect for the user that is using Moose (in terms of intuitive error messages) just like the one above.

What's to be done in this case ?

I mean I get on my screen these error messages that are sometimes completely unrelated to the problem that I'm having (which I can assess after solving the problems that probably caused them, I say probably becuase I have no idea where these error messages came from because they look like they fell from the sky as they have no relation to the actual situation). Is this:

  • the inexplicable dramatic destiny of the Perl programmer using Moose ?
  • someone being extremely lazy and sloppy at writing error messages ? maybe on heavy drugs ?
  • me not understanding basic english ?

Gentlemen, when writing software, please please please, take care of the poor programmer that will use it and respect him by writing relevant error messages.

(Except for error messages Moose is a pretty good piece of software)

© Stack Overflow or respective owner

Related posts about perl

Related posts about moose